//====================================================================
//Ragnarok Online EP4.0(J) Marriage System      V1.0
//
//   @event_marry -> IǬ 0or1
//   @defend -> ǻ~|ǿǬBRUfKg
//
//	լdeqRih@rUNARɧMe@ by Rayce
//====================================================================
prt_church.gat,94,100,4	script	BAȤH	71,{
	cutin "wedding_marry01",2;
	mes "[Bּ]";
	mes "ҿתBA";
	mes "OҦHƱoڷQ֡C";
	mes "urur~~DKK";
	mes "zNOӷQnBHܡH";
	next;
	switch (select("лB§Ʊ","аݵB§L{OˤlOH","ڷQnӽеB§","ڭ̬OLĪ樭xΡI")) {
	case 1:
		mes "[Bּ]";
		mes "BOѿc-̼w[";
		mes "SOZ3@U˦|檺A";
		mes "ҦssQ֪C";
		next;
		mes "[Bּ]";
		mes "ѩaưcA";
		mes "XﱵUA";
		mes "ҥHSNܽШ촶wԤjаA";
		next;
		mes "[Bּ]";
		mes "A󵲱BKK";
		mes "зV|C";
		mes "@BANA]SĨ⦸FC";
		mes "BFHA";
		mes "YϤ@H}FH@]|ûb@_C";
		next;
		mes "[Bּ]";
		mes "uOkʩMkʡAkʩMkʵBC";
		mes "t~PʩΪ̬OM]Bo˪DiKK";
		mes "UO|{PA";
		mes "н̸ѡC";
		next;
		mes "[Bּ]";
		mes "pGwgwnӪHA";
		mes "յۨDBpH";
		mes "֥өҦʤHoڷQ֡II";
		close2;
		cutin "wedding_marry01",255;
		end;
	case 2:
		mes "[Bּ]";
		mes "AssQVڴXӽеB§C";
		mes "XӽЪӤHնA";
		mes "MХhUC";
		next;
		mes "[Bּ]";
		mes "̶}l^0000FFk^000000MUܡC";
		mes "åBХT^QBkʪWrC";
		next;
		mes "[Bּ]";
		mes "siA䦸OsQC";
		mes "Ц^UsTWrC";
		next;
		mes "[Bּ]";
		mes "iB誺Wr";
		mes "Ni٫洫AA";
		mes "ӤHN|oFëRҩC";
		next;
		mes "[Bּ]";
		mes "ӽеB§HܦhpUA";
		mes "ЫǵݡC";
		mes "Uu1ӡA";
		mes "LkP|hӵB§C";
		next;
		mes "[Bּ]";
		mes "MA|iUɭԡA";
		mes "^ff0000̶}lsܤAЦb3ҦL{^000000";
		mes "pGb3LkpUANA]LkBC";
		next;
		mes "[Bּ]";
		mes "٦AbiUBﹳWrɭԡA";
		mes "Ф@wnTC";
		mes "iyL~ܷ|ް_nêC";
		next;
		mes "[Bּ]";
		mes "bB§eA";
		mes "@wnMBﹳT{WrTgC";
		next;
		mes "[Bּ]";
		mes "ѨMkA";
		mes "NOMյ۶iKyNnFC";
		mes "q򨺭ӦWrNOTgA";
		mes "pG౵qA";
		mes "NOWr˿iʡC";
		next;
		mes "[Bּ]";
		mes "Ao@yKyA";
		mes "UѵfsC";
		mes "o˪ܡA";
		mes "iHbKyWܹ̿誺WrC";
		next;
		mes "[Bּ]";
		mes "誺WrbsX{A";
		mes "墨ӦWr Ctrl+C iƻsC";
		mes "o˰FA";
		mes "iɭԥ ShiftInsert NiHN誺Wr˥XӤFC";
		next;
		mes "[Bּ]";
		mes "1)MαKy";
		mes "2)bKyWܹ̿Wr";
		mes "3)bѵfUܹ誺WrA";
		mes " Ctrl+C ƻsC";
		next;
		mes "[Bּ]";
		mes "oӤkA";
		mes "TꪺO誺WrA";
		mes "ڷQiHbVUiɭԨϥΡC";
		next;
		mes "[Bּ]";
		mes "]ouOA";
		mes "յ۹1aC";
		next;
		mes "[Bּ]";
		mes " CtrlC ƻsWrA";
		mes "M ShiftInsert ߶KXӵڬݬݦnܡH";
		next;
		input '@test$;
		mes "[Bּ]";
		mes "ˡAǷ|FܡH";
		next;
		mes "[Bּ]";
		mes "pGQBHA";
		mes "@wnӳo̥ӽЮ@C";
		close2;
		cutin "wedding_marry01",255;
		end;
	case 3:
		cutin "wedding_marry02",2;
		mes "[Bּ]";
		mes "Fi浲B§A";
		mes "HUXӱC";
		next;
		mes "[Bּ]";
		mes "AFB^3377FFHťb45HW^000000C";
		mes "MAnssQH@_nӽСC";
		next;
		mes "[Bּ]";
		mes "ӽЪɭԡAkݭn^3377FF1,300,000zeny^000000M";
		mes "^3377FFPA1^000000C";
		mes "kݭn^3377FF1,200,000zeny^000000M";
		mes "^3377FFB§A1^000000C";
		next;
		mes "[Bּ]";
		mes "٦AǳƦnB٫A";
		mes "]OBAҥHssQOCH1ӡA";
		mes "зǳƦn^3377FFpۧ٫^000000C";
		mes "s1ӡAsQ1ӡC";
		next;
		mes "[Bּ]";
		mes "HW~T{A";
		mes "ЦbӽЮѤWgWۤvWrC";
		next;
		mes "[Bּ]";
		mes "pGHӽЧFA";
		mes "N}l|B§§FC";
		mes "{bNnӽжܡH";
		next;
		if(select("O","O")==2) {
			mes "[Bּ]";
			mes "A@ө֪@ѡI";
			close2;
			cutin "wedding_marry02",255;
			end;
		}
		if(PartnerId) {
			mes "[Bּ]";
			mes "nAOwgLBFC";
			mes "UOӻ{BC";
			next;
			mes "[Bּ]";
			mes "}aӥHe@ͦ@PۦuwA";
			mes "O˪NqKK";
			mes "AQL誺߱ܡH";
			next;
			mes "[Bּ]";
			mes "Bu@C";
			mes "YϹ覺FA}]OëC";
			close2;
			cutin "wedding_marry02",255;
			end;
		}
		if(Upper == 2) {
			//ilɭԩOHլd
			close2;
			cutin "wedding_marry02",255;
			end;
		}
		if(@event_marry) {
			mes "[Bּ]";
			mes "urAwgHӽФFA";
			mes "Uwgb̭FA";
			mes "UbiFA";
			mes "ЫǵݡC";
			close2;
			cutin "wedding_marry02",255;
			end;
		}
		if(BaseLevel<45) {
			mes "[Bּ]";
			mes "DBeAnҦۤvC";
			mes "BۥtqȩMdC";
			mes "AܱjiHu@褧A";
			mes "AӧڧaC";
			close2;
			cutin "wedding_marry02",255;
			end;
		}
		if(countitem(2613)<1) {
			mes "[Bּ]";
			mes "nAѰOaӥΧ@B٫pۧ٫FC";
			mes "Apۧ٫aӤFAӥӽЧaC";
			close2;
			cutin "wedding_marry02",255;
			end;
		}
		if((Sex==0 && countitem(2338)<1) || (Sex==1 && countitem(7170)<1)) {
			mes "[Bּ]";
			if(Sex==0) {
				mes "urAB§AFH";
				mes "|浲B§ɡAsQS§AKK";
				mes "oiO@ͤ@ưڡA";
			}
			else {
				mes "urAPAFH";
				mes "|浲B§ɡAsN˯bKK";
				mes "oiO@ͤ@ưڡA";
			}
			mes "ЧOѰOǳưڡC";
			close2;
			cutin "wedding_marry02",255;
			end;
		}
		if((Sex==0 && Zeny<1200000) || (Sex==1 && Zeny<1300000)) {
			mes "[Bּ]";
			mes "QpALAB§O";
			if(Sex==0)
				mes "ݭn1,200,000zenyC";
			else
				mes "ݭn1,300,000zenyC";
			close;
		}
		mes "[Bּ]";
		mes "PA̱NnBI";
		next;
		mes "[Bּ]";
		mes "AoӬOӽЮѡC";
		mes "Цbo̼gWۤvWrC";
		while(1) {
			next;
			input '@name$;
			if('@name$ != strcharinfo(0)) {
				mes "[Bּ]";
				mes "CۺCۡI";
				mes "oOAۤvTWrC";
				mes "nO⵲BAХTgXۤvWrA";
				mes "KKAӤ@A";
				mes "bo̦nnTgWۤvWrC";
				continue;
			}
			break;
		}
		delitem 2613,1;
		if(Sex==0) {
			delitem 2338,1;
			set Zeny,Zeny-1200000;
		}
		else {
			delitem 7170,1;
			set Zeny,Zeny-1300000;
		}
		set @event_marry,1;
		mes "[Bּ]";
		mes "nFAFAӽЮѤFC";
		mes "@|A٭nVUiBHWrC";
		mes "b|浲B§eFॿTX誺WrA";
		mes "˧AwǳƦnC";
		next;
		mes "[Bּ]";
		mes "ApGBH]FӽСA";
		mes "ЧĄHզ@A";
		mes "Uwgb̭ԤFC";
		next;
		mes "[Bּ]";
		mes "KKA̩֡";
		emotion 3;
		close2;
		cutin "wedding_marry02",255;
		end;
	case 4:
		cutin "wedding_marry02",2;
		emotion 23;
		hideoffnpc "樭x#w";
		hideoffnpc "樭x#N";
		hideoffnpc "樭x#ùJ";
		hideoffnpc "樭x#";
		hideoffnpc "樭x#᫰";
		hideoffnpc "樭x#X[";
		emotion 27,"樭x#w";
		emotion 27,"樭x#N";
		emotion 27,"樭x#ùJ";
		emotion 27,"樭x#";
		emotion 27,"樭x#᫰";
		emotion 27,"樭x#X[";
		mes "[樭x]";
		mes "ҭnۤvA~|XnFI";
		mes "b}޸̲նOת欰I";
		mes "ڪߨMwbNPCI";
		mes "qXͨ¾AOۤvmI";
		mes "tϸ`ɭԡA~ޯD͡I";
		mes "ڭ̬OLĪ樭xΡI";
		next;
		hideonnpc "樭x#w";
		hideonnpc "樭x#N";
		hideonnpc "樭x#ùJ";
		hideonnpc "樭x#";
		hideonnpc "樭x#᫰";
		hideonnpc "樭x#X[";
		emotion 4;
		close2;
		cutin "wedding_marry02",255;
		end;
	}
OnInit:
	hideonnpc "樭x#w";
	hideonnpc "樭x#N";
	hideonnpc "樭x#ùJ";
	hideonnpc "樭x#";
	hideonnpc "樭x#᫰";
	hideonnpc "樭x#X[";
	end;
}

//========================================================================================
prt_church.gat,99,125,4	script	U	108,{
	//1QpݵLNuB2NBKH~Qpu
	if('flag==1 || ('flag==2 && strcharinfo(0) != 'bride$)) {
		mes "[SOZ3@]";
		mes "LHi椤C";
		mes "ЫǵݡC";
		close;
	}
	if(PartnerId) {
		mes "[SOZ3@]";
		mes "Aû֡C";
		close;
	}
	if(@event_marry==0) {
		mes "[SOZ3@]";
		mes "pGƱ浲BA";
		mes "ЭhӽСC";
		close;
	}
	if(Sex==1) {	//fVsp
		getpartymember getcharid(1);
		for(set '@i,0; '@i<2; set '@i,'@i+1) {
			if($@partymembername$['@i] != strcharinfo(0))
				set '@another$,$@partymembername$['@i];		//PTR~rۤUWey@ɫOs
		}
		if($@partymembercount != 2 || readparam(Sex,'@another$) == 1) {	//2HPTjQBiVۤkǦ~
			mes "[SOZ3@]";
			mes "Ʊ浲BܡA";
			mes "|浲B§HնC";
			close;
		}
		if(readparam(Upper,'@another$) == 2) {
			//ﹳpGOilɭԡHլd
			close;
		}
		set 'flag,1;
		initnpctimer;	//򭭮3
		set 'groom$,strcharinfo(0);
		mes "[SOZ3@]";
		mes "ڷQө֪~HC";
		mes "HV֪HͧaA";
		mes "@PLɭԱN";
		mes "Hû_KK";
		next;
		announce "U: s" +'groom$+ "AݧAӰDKK",9;
		mes "[SOZ3@]";
		mes 'groom$+ "C";
		mes "bo̫ŧiNn{GģANӡA";
		mes "@PLA@ͪkʪWrC";
		next;
		input 'bride$;
		if('bride$ != '@another$) {	//ǿǷǴsNUH
			announce "U: nǳƤڡKKUA|aC",9;
			stopnpctimer;
			set 'flag,0;
			close;
		}
		//iǬ~MrQpKesFǻ~|ǿǬyZt@
		if(attachrid(getcharid(3,'bride$))) {
			set @defend,0;
			detachrid;
		}
		if(attachrid(getcharid(3,'groom$))) {	//A|ǻǿǽ
			//PTsMo@NRǬ|ǢĪANtYQIഫVҼ{Q
			announce "U: AAbIΪɭԡBhaɭԡBͯfɭԡBdɭ",9;
			mes "[SOZ3@]";
			mes "s" +'groom$+ "C";
			mes "AAbIΪɭԡBhaɭԡB";
			mes "ͯfɭԡBdɭԡB";
			mes "]R" +'bride$+ "A";
			mes "LqoBwoBUoA";
			mes "o}ͩR׵uoӸ`ޡC";
			next;
			announce "U: ]R" +'bride$+ "ALqoBwoBUoAo}ͩR׵uoӸ`",9;
			menu "ڵo}",-;
			announce "U: s" +'groom$+ "bsQ" +'bride$+ "eoXR}KK",9;
			mes "[SOZ3@]";
			mes "nFCA۰ݷsQݬݧaC";
			set 'flag,2;
			set @event_marry,0;	//
		}
		close;
	}
	//sUBz
	if('flag==0) {
		mes "[SOZ3@]";
		mes "AзsVڳiC";
		close;
	}
	mes "[SOZ3@]";
	mes "ڷQө֪~HC";
	mes "HV֪HͧaA";
	mes "@PLɭԱN";
	mes "Hû_KK";
	next;
	announce "U: sQ" +'bride$+ "AݧAӰDKK",9;
	mes "[SOZ3@]";
	mes "" + 'bride$+ "C";
	mes "Qng`O@AA";
	mes "@PLA@ͪkʪWrO";
	mes "" +'groom$+ "ܡH";
	next;
	if(select("O","O")==2) {
		//լdH
		mes "[SOZ3@]";
		mes "o˰";
		announce "U: sQnQFKKUA|aC",9;
		stopnpctimer;
		set 'flag,0;
		close;
	}
	announce "U: AAbIΪɭԡBhaɭԡBͯfɭԡBdɭ",9;
	mes "[SOZ3@]";
	mes "sQ" +'bride$+ "C";
	mes "AAbIΪɭԡBhaɭԡB";
	mes "ͯfɭԡBdɭԡB";
	mes "]R" +'groom$+ "A";
	mes "LqLBwLBULA";
	mes "o}ͩR׵uoӸ`ޡC";
	next;
	announce "U: ]R" +'groom$+ "ALqLAwLAULAo}ͩR׵uoӸ`",9;
	if(select("ڵo}","KK٬Oa")==2) {
		//լdH
		mes "[SOZ3@]";
		mes "o˰";
		announce "U: sQnQFKKUA|aC",9;
		stopnpctimer;
		set 'flag,0;
		close;
	}
	if(@defend) {	//ǻ~|ǿMrP̲ǽǣǿǫ
		set @event_marry,0;
		mes "Time up...";
		close;
	}
	//BBz
	if(getcharid(3,'groom$)<=0) {	//sǿǴNǬ|ǢMFpBQI
		stopnpctimer;
		set 'flag,0;
		set @event_marry,0;
		mes "Groom not exist";
		close;
	}
	set '@dummy,marriage('groom$);
	getitem 2635,1,0;
	getitem 2634,1,0,getcharid(3,'groom$);
	set 'flag,0;
	set @event_marry,0;
	sc_start SC_WEDDING,3600000,0;
	sc_start SC_WEDDING,3600000,0,getcharid(3,'groom$);
	wedding;
	stopnpctimer;
	announce "U: s" +'groom$+ "MsQ" +'bride$+ "Aboַ̯sҰϥ͡I",9;
	mes "[SOZ3@]";
	mes "Hc-̼w[ꪺ";
	mes "SOZT@WqA";
	mes "֧ĄHӡC";
	next;
	mes "[SOZ3@]";
	mes "H@_KKû֡KK";
	close;
//sM3HRBQOC(UARQJMieFBWBiH)
OnTimer180000:
	announce "U: ^ӺCFKKUA|aC",9;
	set 'flag,0;
	//ǻ~|ǿUXVRǬyKg
	//BBzeRǽǣǿǫ@rONBBBz򭫽@rUyI
	if(attachrid(getcharid(3,'bride$)))
		set @defend,1;
	end;

/* HUUǿǷǴVXQVAN@KH
   ~QOʧOPwOV@NRkJMrC by Rayce
LError2:
	mes "[SOZ3@]";
	mes "Error!";
	mes "sQbڡC";
	mapannounce "prt_church.gat","U: nǳƤڡKKUA|aC",8;
	stopnpctimer;
	set $@marry,0;
	close;
LError3:
	mes "[SOZ3@]";
	mes "Error!";
	mes "ʧOPw";
	mes "HReadparam:"+readparam(21,strcharinfo(0));
	mes "ﹳReadparam:"+readparam(21,$@NameWoman$);
	mapannounce "prt_church.gat","U: nǳƤڡKKUA|aC",8;
	stopnpctimer;
	set $@marry,0;
	close;
*/
}

//=======================Solox==============================
prt_church.gat,97,102,0	script	樭x#w	105,{
	mes "[樭x]";
	mes "ҭnۤvA~|XnFI";
	close;
}

prt_church.gat,98,102,0	script	樭x#N	705,{
	mes "[樭x]";
	mes "b}޸̲նOת欰I";
	close;
}

prt_church.gat,99,102,0	script	樭x#ùJ		707,{
	mes "[樭x]";
	mes "ڪߨMwbNPCI";
	close;
}

prt_church.gat,100,102,0	script	樭x#	708,{
	mes "[樭x]";
	mes "qXͨ¾AOۤvmI";
	close;
}

prt_church.gat,101,102,0	script	樭x#᫰	767,{
	mes "[樭x]";
	mes "tϸ`ɭԡA~ޯD͡I";
	close;
}

prt_church.gat,102,102,0	script	樭x#X[	780,{
	mes "[樭x]";
	mes "ڭ̬OLĪ樭xΡI";
	close;
}
